<div id="cleaning-order-view">
  <div class="page">
    <div class="al-list-container">
      <form class="form-horizontal al-search-container" role="form">
        <div class="form-group">
          <label class="col-sm-2 control-label">公寓</label>
          <div class="col-sm-2" ng-if="apartmentList.length>1">
            <qgy-apartment-item apm-data="search" apm-list="apartmentList"></qgy-apartment-item>
          </div>
          <label class="col-sm-2 control-label">服务时间</label>
          <div class="col-sm-2">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                     ng-model="search.serviceTimeStart" is-open="enterStart" maxlength="10"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterStart=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
          <label class="control-label text-center al-fl-lt">&nbsp;&nbsp;~&nbsp;&nbsp;</label>
          <div class="col-sm-2">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                     ng-model="search.serviceTimeEnd" is-open="enterEnd" maxlength="10"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterEnd=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">状态</label>
          <div class="col-sm-10">
            <label class="ui-radio" ng-repeat="item in orderStatuslist">
              <input name="status" ng-value="item.value" type="checkbox"  ng-checked="isSelected(item.value)" ng-click="updateSelection($event,item.value)">
              <span>{{item.name}}</span>
            </label>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-4 col-sm-offset-2">
            <input class="form-control" type="text" placeholder="订单号、客户姓名、客户手机、订单内容"
                   ng-model="search.filter" maxlength="32">
          </div>
          <div class="col-sm-1 col-sm-offset-2">
            <button type="button" ng-click="queryData()" class="btn btn-success al-float-right">查询</button>
          </div>
          <div class="col-sm-1">
            <button type="button" ng-click="resetSearch()" class="btn btn-default">重置</button>
          </div>
          <div class="col-sm-1 col-sm-offset-1" style="float: right">
            <button class="btn btn-primary"
                    style="float:right"
                    ng-if="!exporting"
                    data-ng-disabled="exporting"
                    ng-confirm-click="确定要导出吗？"
                    ng-click="exportData()">
              导出Excel
            </button>
            <button class="btn btn-primary"
                    style="float:right"
                    ng-if="exporting"
                    disabled>
              正在导出。。
            </button>
          </div>
        </div>
      </form>
      <table ng-table="tableParams"
             class="table  table-bordered table-striped table-condensed al-table-container">
        <thead>
        <tr>
          <td>序号</td>
          <td>订单号</td>
          <td>公寓</td>
          <td>房间号</td>
          <td>金额</td>
          <td>订单内容</td>
          <!--<td>下单时间</td>-->
          <td>客户姓名</td>
          <td>客户手机号</td>
          <td>客户备注</td>
          <td>付款日期</td>
          <td>服务日期</td>
          <td>状态</td>
          <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in $data">
          <td>{{$index+1}}</td>
          <td>{{item.orderNo}}</td>
          <td>{{item.apartmentName}}</td>
          <td>{{item.houseNo}}</td>
          <td>{{item.payMoney}}</td>
          <td>{{item.title}}</td>
          <!--<td>{{item.createTime|dateTransfer:'YYYY-MM-DD'}}</td>-->
          <td>{{item.customerName}}</td>
          <td>{{item.customerPhone}}</td>
          <td>{{item.customerRemark}}</td>
          <td>{{item.payTime|dateTransfer:'YYYY-MM-DD'}}</td>
          <td>{{item.serviceTime|dateTransfer:'YYYY-MM-DD HH:mm'}}</td>
          <td>{{item.statusName}}</td>
          <td>
            <button class="btn btn-info btn-sm" ng-click="viewData(item)">查看</button>
            <button class="btn btn-success btn-sm" ng-if="item.status==2"
                    ng-click="dealData(item)">处理</button>
          </td>
        </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
